import random


class Vctor:
   def __init__(self, a, b):
      self.a = a
      self.b = b
 
   def __str__(self):
      return 'Vctor (%d, %d)' % (self.a, self.b)
   
   def __add__(self,other):
      return Vctor(self.a + other.a, self.b + other.b)
   def __sub__(self,other):
      return Vctor(self.a - other.a, self.b - other.b)
   def __mul__(self,other):
      return Vctor(self.a * other.a, self.b * other.b)
   def __mod__(self,other):
      return Vctor(self.a % other.a, self.b % other.b)
v1 = Vctor(2,10)
v2 = Vctor(5,2)
print(v1+v2)
print(v1-v2)
print(v1*v2)
print(v1%v2)
print(1/2)
v3 = Vctor(222,999)
print(v3)
#随机数
random.seed(10)
print(random.random())
print(random.randrange(10,100,12))

for c in '12345678':
    print(c,end=',')

ls=[123,456,789,100,111]
print(random.choice(ls))    
for c in ls:
    print(c,end='-')
pi=0
N=100
for k in range(N):
    pi +=1/pow(16, k)*( \
        4/(8*k+1)-2/(8*k+4)-\
        1/(8*k+5)-1/(8*k+6))
print("圆周率值是：{}".format(pi))

 

